home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Scale / NeonLight.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  2.6 KB  |  112 lines

  1. ========== Description Part Begin ==========
  2. name = "NeonLight";
  3. description = "To imitate neon lights switching colors.";
  4. version = "1.00";
  5. bin = "NeonLight.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11.  
  12. $nInterval(EDIT,INT,8,0 1000,"Interval","The time difference between the former character and the latter one beginning to change.");
  13. $nScaleSpeed(EDIT,INT,5,1 1000,"Scaling Speed","The speed of character scaling.");
  14. $nMaxScale(EDIT,INT,200,1 1000,"Max Scaling","The maximun scaling value that a character will be scaled.");
  15.  
  16. ========== Parameter Part End ==========
  17.  
  18. ========== Function Part Begin ==========
  19. nCharacterCount = 8;
  20. nFrameCount = 4;
  21.  
  22. nInterval = 8;
  23. nScaleSpeed = 5;
  24. nMaxScale = 200;
  25.  
  26.  
  27. nIsRun = new Array(nCharacterCount);
  28. nMax = nCharacterCount * 3;
  29. nOriginalSizeX = new Array(nCharacterCount);
  30. nOriginalSizeY = new Array(nCharacterCount);
  31.  
  32.  
  33.  
  34. for(i = 1;i <= nCharacterCount;i++)
  35. {
  36.     nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
  37.     nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
  38.     
  39.     this["c" + i]._xscale = nMaxScale;
  40.     this["c" + i]._yscale = nMaxScale;
  41.  
  42.     if(i == 1)
  43.             nIsRun[0] = 0;
  44.     else
  45.     {
  46.             nIsRun[i - 1] = nIsRun[i - 2];
  47.             nIsRun[i - 1] += nInterval;
  48.     }
  49.         
  50.     this["c" + i]._visible = false;
  51.     
  52.     
  53.     
  54. }
  55.  
  56.  
  57.  
  58.  
  59. function again()
  60. {
  61.     gotoAndPlay(2);
  62. }
  63.  
  64.  
  65.  
  66. function fun()
  67. {
  68.     for(i = 1;i <= nCharacterCount;i++)
  69.     {    
  70.         if(nIsRun[i -1] < 0)
  71.         {
  72.                 tempColor = new Color(this["c" + i]);
  73.                 col = random(0xffffff);
  74.                 tempColor.setRGB(col);
  75.             
  76.                 this["c" + i]._visible = true;
  77.                 this["c" + i]._xscale -= nScaleSpeed;
  78.                 this["c" + i]._yscale -= nScaleSpeed;
  79.                 if(this["c" + i]._xscale < nOriginalSizeX[i - 1] )
  80.                 {
  81.                     this["c" + i]._xscale = nOriginalSizeX[i - 1] ;
  82.                     this["c" + i]._yscale = nOriginalSizeY[i - 1] ;
  83.                     
  84.                 }
  85.                 
  86.         }
  87.         else
  88.             nIsRun[i -1]--;
  89.         
  90.         
  91.     }
  92.     
  93.     if(this["c" + nCharacterCount]._xscale == nOriginalSizeX[nCharacterCount - 1] )
  94.     {
  95.  
  96.         gotoAndPlay(1);
  97.     }
  98. }
  99.  
  100.  
  101. ========== Function Part End ==========
  102.  
  103. ========== Frame Part Begin ==========
  104. $frame(fun,1,-1,"fun");
  105. $frame(fun,2,-1,"fun");
  106. $frame(again,3,-1,"again");
  107. ========== Frame Part End ==========
  108.  
  109.  
  110.  
  111.